<!--  -->
<template>
  <div ref="charts" class="charts" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  data() {
    return {
    }
  },
  mounted() {
    const lineChart = echarts.init(this.$refs.charts)
    lineChart.setOption({
      xAxis: {
        show: false,
        type: 'category'
      },
      yAxis: {
        show: false
      },
      series: [
        {
          type: 'line',
          data: [10, 7, 33, 12, 88, 64, 32, 9, 19, 23, 41, 28, 48, 39, 20, 62, 91, 20, 64, 32, 9, 19, 23, 7, 33, 12, 88, 64, 32, 94, 20, 38, 41, 28, 48, 39, 20, 62, 91, 20, 64],
          // 拐点样式
          itemStyle: {
            opacity: 0
          },
          // 线条样式
          lineStyle: {
            color: 'purple'
          },
          // 区域填充样式
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: 'purple' // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: '#fff' // 100% 处的颜色
                }
              ],
              global: false // 缺省为 false
            }
          }
        }
      ],
      grid: {
        top: 0,
        rigth: 0,
        bottom: 0,
        left: 0
      },
      tooltip: {}
    })
  }
}
</script>

<style  scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>
